package com.tfjybj.itoo.exam.provider.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tfjybj.itoo.exam.entity.TemplateDetailsExtractEntity;
import com.tfjybj.itoo.exam.model.QuestionMainModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * TemplateDetailsExtractDao接口
 * templateDetailsExtract表
 *
 * @author 任晓帅
 * @version 2.0.0
 * @since 2.0.0 2018-11-15 19:40:28
 */
@Repository("templateDetailsExtractDao")
public interface TemplateDetailsExtractDao extends BaseMapper<TemplateDetailsExtractEntity> {
	
	//region 模板生成：模糊查询
	/**
     * 根据试题id模糊查询templateDetailsExtract
     *
     * @param questionId  试题id
     * @return 模糊查询的templateDetailsExtract集合
     * @author 任晓帅
     * @since 2.0.0 2018-11-15 19:40:28
     */
    List<TemplateDetailsExtractEntity> queryLikeQuestionId(@Param("questionId") String questionId);


    //endregion

    /* **********************************以下为非模板生成的内容********************************* */
    /**
     * 根据模板id查询templateDetailsExtract
     *
     * @param templatedetailsId  模板id
     * @return 查询的templateDetailsExtract
     * @author 杨海云
     * @since 2.0.0 2018-11-27 19:40:28
     */
    List<QuestionMainModel> queryQueExtractByTemplateId(@Param("templatedetailsId") String templatedetailsId);
    /**
     * 根据模板id查询templateDetailsExtract
     *
     * @param templateDetsilsId  模板id
     * @return 查询的templateDetailsExtract
     * @author 杨海云
     * @since 2.0.0 2018-11-27 19:40:28
     */

    List<TemplateDetailsExtractEntity> queryDetilsExtractBytemplateDetailsId(@Param("templateDetsilsId") String templateDetsilsId);

    /**
     * 如果修改的错题是模板必抽题,将新题更新到模板必抽题表
     *
     * @param wrongQuestionId 错题id
     * @return 查询的templateDetailsExtract
     * @author 任蒙蒙
     * @since 2.0.0 2018-12-28 21:02:28
     */
    Boolean updateQuestionId(@Param("wrongQuestionId") String wrongQuestionId, @Param("newQuestionId") String newQuestionId);
}
